<template>
    <router-view/>
    <div class="bottonnav">
        <Nav v-if="true">
           <navitem path = '/news'>
                <template v-slot:navimg>
                    <span class="iconfont">&#xe604;</span>
                </template>
               <template v-slot:navtext>
                    <span>消息</span>
                </template>
            </navitem>
           <navitem path = '/me'>
                <template v-slot:navimg>
                    <span class="iconfont">&#xe70b;</span>
                </template>
                <template v-slot:navtext>
                    <span>我的</span>
                </template>
            </navitem>
        </Nav>
    </div>
</template>

<script>
// import { ref, inject } from 'vue';
import { useRouter } from 'vue-router';
import Nav from './components/public/bottnav/Nav.vue';
import Navitem from './components/public/bottnav/Navitem.vue';

export default {
  name: 'App',
  components: {
    Nav,
    Navitem,
  },
  setup() {
    const router = useRouter();
    const token = JSON.parse(window.sessionStorage.getItem('token'));
    if (!token) {
      router.replace('/loginview');
    } else {
      router.replace('/me');
    }
    // const yorn = computed(() => {
    //   if (route.path = '/socketview') {
    //     return false;
    //   }
    //   return true;
    // });
    return {
      // yorn,
    };
  },
};
</script>

<style>
    @import url("assets/css/iconfont.css");
    @import url("assets/css/normalize.css");

    #app {
        font-family: Avenir, Helvetica, Arial, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-align: center;
        color: #2c3e50;
    }

    * {
        box-sizing: border-box;
    }
    body {
        background-color: #ececec;
    }

    #nav {
        padding: 30px;
    }

    #nav a {
        font-weight: bold;
        color: #2c3e50;
    }

    #nav a.router-link-exact-active {
        color: #42b983;
    }
    input{
        outline: none;
    }
    li{
        list-style: none;
    }
</style>
